<html>
<head><meta charset="utf-8"><title>how to know which problem caused rustc hang when LTO=thin ? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20know.20which.20problem.20caused.20rustc.20hang.20when.20LTO.3Dthin.20.3F.html">how to know which problem caused rustc hang when LTO=thin ?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="212063861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20know%20which%20problem%20caused%20rustc%20hang%20when%20LTO%3Dthin%20%3F/near/212063861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lzutao <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20know.20which.20problem.20caused.20rustc.20hang.20when.20LTO.3Dthin.20.3F.html#212063861">(Oct 02 2020 at 11:52)</a>:</h4>
<p>Was trying to use flamegraph, but having no debug-info in nightly rustc.<br>
I'm building rustc with debug on.</p>
<p>Is there any other ways to get the backtrace that causing rustc hang ?</p>



<a name="212065524"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20know%20which%20problem%20caused%20rustc%20hang%20when%20LTO%3Dthin%20%3F/near/212065524" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lzutao <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20know.20which.20problem.20caused.20rustc.20hang.20when.20LTO.3Dthin.20.3F.html#212065524">(Oct 02 2020 at 12:12)</a>:</h4>
<p>there are many debug settings in config.toml, which one should I use ?<br>
Could you give a help, <span class="user-mention" data-user-id="124288">@oli</span>  ?</p>



<a name="212065629"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20know%20which%20problem%20caused%20rustc%20hang%20when%20LTO%3Dthin%20%3F/near/212065629" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20know.20which.20problem.20caused.20rustc.20hang.20when.20LTO.3Dthin.20.3F.html#212065629">(Oct 02 2020 at 12:13)</a>:</h4>
<p>The only way to debug rustc hangs that I know about is to take the entire command line that hangs and run it with <code>gdb --args</code> and then <code>Ctrl + C</code> once it hangs and look at the backtrace with <code>bt</code></p>



<a name="212065664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20know%20which%20problem%20caused%20rustc%20hang%20when%20LTO%3Dthin%20%3F/near/212065664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20know.20which.20problem.20caused.20rustc.20hang.20when.20LTO.3Dthin.20.3F.html#212065664">(Oct 02 2020 at 12:13)</a>:</h4>
<p>you may need to use <code>./x.py your flags --verbose</code> to see the actual command line to copy</p>



<a name="212065765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20know%20which%20problem%20caused%20rustc%20hang%20when%20LTO%3Dthin%20%3F/near/212065765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lzutao <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20know.20which.20problem.20caused.20rustc.20hang.20when.20LTO.3Dthin.20.3F.html#212065765">(Oct 02 2020 at 12:14)</a>:</h4>
<p>oops, that's easy. was trying to use flamegraph with a debug-info enabled rustc</p>



<a name="212066991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20know%20which%20problem%20caused%20rustc%20hang%20when%20LTO%3Dthin%20%3F/near/212066991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lzutao <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20know.20which.20problem.20caused.20rustc.20hang.20when.20LTO.3Dthin.20.3F.html#212066991">(Oct 02 2020 at 12:28)</a>:</h4>
<p>thank oli, opened  <a href="https://github.com/rust-lang/rust/issues/77450">#77450</a> .</p>



<a name="212069059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20know%20which%20problem%20caused%20rustc%20hang%20when%20LTO%3Dthin%20%3F/near/212069059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20know.20which.20problem.20caused.20rustc.20hang.20when.20LTO.3Dthin.20.3F.html#212069059">(Oct 02 2020 at 12:47)</a>:</h4>
<p>hmm... from thab backtrace it doesn't look like you waited long enough, this is still in the middle of compiling things</p>



<a name="212069090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20know%20which%20problem%20caused%20rustc%20hang%20when%20LTO%3Dthin%20%3F/near/212069090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20know.20which.20problem.20caused.20rustc.20hang.20when.20LTO.3Dthin.20.3F.html#212069090">(Oct 02 2020 at 12:47)</a>:</h4>
<p>(though at the "generate llvm bytecode stage")</p>



<a name="212069993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20know%20which%20problem%20caused%20rustc%20hang%20when%20LTO%3Dthin%20%3F/near/212069993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lzutao <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20know.20which.20problem.20caused.20rustc.20hang.20when.20LTO.3Dthin.20.3F.html#212069993">(Oct 02 2020 at 12:55)</a>:</h4>
<p>you're right, I have different backtrace when attaching the hang process instead of ctrl-c.<br>
Updated the post.</p>



<a name="212073394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20know%20which%20problem%20caused%20rustc%20hang%20when%20LTO%3Dthin%20%3F/near/212073394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lzutao <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20know.20which.20problem.20caused.20rustc.20hang.20when.20LTO.3Dthin.20.3F.html#212073394">(Oct 02 2020 at 13:24)</a>:</h4>
<p>Is  thin-lto compilation time different much with no lto build ?<br>
If not, I'm sorry for filing a false positive issue.<br>
Thanks oli for the help anyway.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>